package com.ruijiang.service.VmService.Impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruijiang.entity.Business;
import com.ruijiang.mapper.VmServiceMapper.BusinessTypeMapper;
import com.ruijiang.service.VmService.BusinessTypeService;
import com.ruijiang.vo.businessType.BusinessBaseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessTypeServiceImpl extends ServiceImpl<BusinessTypeMapper, Business> implements BusinessTypeService {


    @Autowired
    private BusinessTypeMapper businessTypeMapper;

    /**
     * 获取商圈列表
     * @return
     */
    @Override
    public List<BusinessBaseVO> getBusinessTypeList() {
        List<BusinessBaseVO> list = businessTypeMapper.getBusinessTypeList();
        return list;
    }

    @Override
    public String getBusinessTypeName(String id) {
        return getOne(
                Wrappers.<Business>lambdaQuery()
                        .eq(Business::getId,id)
        ).getName();
    }
}
